#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int purchase(int a)
{
	if (a > 1)
	{
		int b = a / 2;
		int c = a % 2;
		return b + purchase(b + c);
	}
	else
	{
		return 0;
	}
}

int main()
{
	int a = 20;
	int b = a + purchase(a);
	printf("%d", b);
	return 0;
}